package org.example.test.controller;

import org.example.test.entity.Useradmin;
import org.example.test.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {
    @Autowired
    private AdminService adminService;
    @RequestMapping("/login")
    public Useradmin login(@RequestBody Useradmin useradmin){
        return adminService.login(useradmin);
    }
    @RequestMapping("/register")
    public int register(@RequestBody Useradmin useradmin){
        return adminService.register(useradmin);
    }
}
